package com.adms.shiro;

import java.io.Serializable;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;

public class WechatDefaultWebSessionManager extends DefaultWebSessionManager{

	@Override
	protected Serializable getSessionId(ServletRequest request, ServletResponse response) {
		HttpServletRequest httpServletRequest = (HttpServletRequest)request;
		String JSESSIONID = httpServletRequest.getHeader("JSESSIONID");
		if(JSESSIONID != null) {
			return JSESSIONID;
		}
		return super.getSessionId(request, response);
	}
}
